1. Technical Field
This invention relates to data processing and more particularly to an improved computer program method for performing overlapped input/output.
2. Description of the Prior Art
A task frequently performed in a computing center is to copy data from one input/output device to another in bulk quantity. For example, it is frequently necessary to copy the entire contents of a disc pack to magnetic tape. In many computing centers, a back-up copy of the contents of all disc storage is made periodically in order to permit the restoration of disc pack contents in the event of computer malfunction or human error.
For disc packs of large capacity, transferring the entire contents can consume significant amounts of time measured in minutes or perhaps even house, depending upon the average data transfer rate. The hardware design of the computer system places an upper limit on the maximum transfer rate. However, the effective average transfer rate is usually less than this hardware-imposed limit because of delays inherent in the computer program that performs the copy. It is desirable that this copy program be carefully designed to reduce copy delays.
In many computer systems, input/output ("I/O") devices are grouped for data transfer purposes under separate hardware controllers. Typically, for example, a number of disc storage devices is provided with a disc controller while a number of tape devices is provided with a separate tape controller. Some computer systems may have several disc controllers, or several tape controllers, each with its own group of associated I/O devices. Each controller typically transfers data directly into or out of main memory at a high transfer rate by direct memory access, each controller acting independently of the others so that I/O transfer by two or more controllers may occur simultaneously. In a case where two independent controllers are employed, as is generally the case for disc-to-tape or tape-to-disc copy, it is advantageous to use two data buffers in main memory in order to achieve time overlap of the read and the write operations. Data is being read into the first buffer area while data is simultaneously being written out from the second buffer area.
It is usually advantageous for the data buffers to be relatively large in size so that data transfer takes place in large segments. Since the copy program then is called upon to intervene less frequently, overhead associated with the copy program such as disc latency delays may be reduced.
In order to perform double-buffered overlapped I/O in the manner described, it is usually necessary that the computer system provide facilities for the copy program to issue asynchronous I/O requests. An asynchronous request is one which causes the requested I/O operation to begin, with control continuing in the requesting program while the requested operation is taking place. Given this facility, the copy program can proceed in the following straightforward prior art manner. The copy program issues a request to read from a first device into a first buffer area. This activity is begun, and control continues in the copy program which then issues a request to write to a second device from a second buffer area. Overlap of input and output has been achieved; control again continues in the copy program which then may proceed to other matters.
Performing asynchronous I/O requests and employing large amounts of memory for buffer space is generally not a problem when the copy program is in direct control of the hardware resources as is the case, for example, with a specialized stand-alone copy program. Asynchronous I/O is a facility generally provided by the computer system hardware, and the total available space in memory is typically adequate for two large data buffers. However, a stand-alone program for copying may displace a general purpose time-shared operating system that supplies service to a number of users. Generally, it is not desirable for the normal users of a computer system to halt their activities, even temporarily, while copying is done. In most installations it is a requirement that the copy program operate as a user program within the environment of the general purpose operating system. Then the copy program may be utilized by normal system users, and copying can take place contemporaneous with other user activity. However, the memory space available to a user program may restrict the buffer size. Further, many general purpose time-shared operating systems provide only synchronous I/O. Thus a read request will not return control to the user program until the read has been completed and the information read is in memory. Under these circumstances it may not be possible, in the prior art, to attain overlapped operation.